<script setup>
// 触发下载
function triggerDownload() {
  const downloadUrl = 'https://gitee.com/lol1296/smark-android/releases/download/beta-1.0.0/app-debug.apk'
  const link = document.createElement('a')
  link.href = downloadUrl
  link.rel = 'noopener noreferrer'
  link.target = '_blank'
  document.body.appendChild(link)
  link.click()
  document.body.removeChild(link)
}
</script>

<template>
  <div class="download-container">
    <h1 class="title">下载 SMark Android 应用</h1>

    <div class="info">
      <p><strong>版本：</strong> beta-1.0.0</p>
      <p><strong>文件类型：</strong> APK</p>
      <p><strong>注意：</strong> 这是一个测试版本，可能存在不稳定因素</p>
    </div>

    <button
        class="download-button"
        @click="triggerDownload"
    >
      立即下载
    </button>

    <div class="note">
      <p>如果您无法下载，请检查您的网络连接或尝试其他下载方式。</p>
    </div>
  </div>
</template>

<style scoped>
.download-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  font-family: 'Arial', sans-serif;
}

.title {
  color: #333;
  margin-bottom: 1.5rem;
}

.info {
  margin: 1.5rem 0;
  text-align: left;
  color: #666;
}

.info p {
  margin: 0.5rem 0;
}

.download-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin: 1.5rem 0;
}

.download-button:hover {
  background-color: #45a049;
}

.note {
  margin-top: 1.5rem;
  color: #666;
  font-size: 0.9rem;
}
</style>